//
//  IGWorkDetailApi.m
//  jingdongfang
//
//  Created by MTiMac01 on 2017/9/18.
//  Copyright © 2017年 LJL. All rights reserved.
//

#import "IGWorkDetailApi.h"

@implementation IGWorkDetailApi
- (YTKRequestMethod)requestMethod
{
    return YTKRequestMethodPOST;
}

- (NSString *)requestUrl
{
    return @"works/works!ArtWorkDetails.action";
}

- (id)requestArgument
{
    return @{
             @"worksId" : _worksId?:@"",
             @"uId" : [IGUser getUid]
             };
}

- (BOOL)isNeedHub
{
    return NO;
}

@end

@implementation IGWorkDetailModel
+ (BOOL)propertyIsOptional:(NSString *)propertyName
{
    return YES;
}

- (IGShareModel *)getShareModel
{
    IGShareModel *shareModel = [IGShareModel new];
    shareModel.title = self.worksName;
    shareModel.descr = self.worksContent.length>40?[self.worksContent substringToIndex:39]:self.worksContent;
    shareModel.webpageUrl = self.url;
    shareModel.thumbURL = self.worksImage?self.worksImage:nil;
    if ([self.worksSecrecy isEqualToString:@"2"] || [self.examine isEqualToString:@"4"] || [self.examine isEqualToString:@"2"]) {
        shareModel.notallowShare = YES;
    }
    
    return shareModel;
}

@end

@implementation IGWorkDetailResp

@end
